<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>文章列表</title>
</head>
<body>

<#if user??>
    <h2>欢迎你：${user.userName}.</h2>
    <a href="/logout">注销</a>
    <#else>
        <a href="/login">登陆</a>
</#if>


    <h1>所有文章</h1>
    <div>
        <#list articles as article>

            <h2><a href="/article/${article.id}">${article.title}</a></h2>
            <#if user??>
                <a href="/article/${article.id}?method=update">编辑</a>
            </#if>
            <p>作者：<a href="/article?user=${article.user.userName}">${article.user.userName}</a></p>
            <p>${article.content}</p>

        </#list>

    </div>
</body>
</html>